package com.hlyj.http.base.tool.lib_hlyj_base.utils;

import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class LogSendUtil {

    private static final Gson gson = new Gson();

    /**
     * 将Map日志列表转换为接口需要的字符串数组格式
     */
    public static List<String> convertToLogParams(List<Map<String, String>> logs) {
        List<String> params = new ArrayList<>();
        for (Map<String, String> log : logs) {
            params.add(gson.toJson(log)); // 单个对象转JSON字符串
        }
        return params;
    }

}
